package com.neusoft.neuiotms.dcom.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.neusoft.bizcore.auth.common.bean.UserBean;
import com.neusoft.bizcore.web.dto.result.ResultListDTO;
import com.neusoft.bizcore.web.support.Searchable;
import com.neusoft.neuiotms.dcom.dto.DutyArrangementResultDTO;
import com.neusoft.neuiotms.dcom.service.CalendarService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Api(tags = "日程管理")
@RestController
@RequestMapping(value = "/api/w/calendar")
public class CalendarController {

    @Autowired
    private CalendarService calendarService;

    @ApiOperation("查询我的日历")
    @GetMapping
    public ResultListDTO<DutyArrangementResultDTO> myCalendar(final Searchable searchable, final UserBean user) {
        return ResultListDTO.success(this.calendarService.myCalendar(searchable, user));
    }
}
